package com.metronoteapp.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class BaseDao {
	protected Context mContext;
	protected DBHelper mDBHelper;
	protected SQLiteDatabase mDB;

	public BaseDao() {
	}

	public BaseDao(Context _context) {
		this.mContext = _context;
		mDBHelper = new DBHelper(mContext);
	}

	public void setContext(Context _context) {
		this.mContext = _context;
		mDBHelper = new DBHelper(mContext);
	}

	public void openDB() {
		mDB = mDBHelper.getWritableDatabase();
	}

	public void closeDB() {
		if (mDB != null && mDB.isOpen()) {
			mDB.close();
		}
	}
}
